package flinkdemo.kafak;

import com.google.gson.Gson;
import flinkdemo.kafak.entity.VideoMsg;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.functions.sink.RichSinkFunction;

public class ImgFaceSink extends RichSinkFunction<Tuple2<String,VideoMsg>> {

    public ImgFaceSink() {}


    @Override
    public void invoke(Tuple2<String,VideoMsg> msg, Context context) throws Exception {

            Gson gson = new Gson();
            System.out.println(Thread.currentThread().getName()+":"+gson.toJson(msg.f1.getCameraId()));

    }
}